package com.yupi.yupicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yupicturebackend.model.entity.Space;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.model.entity.User;
import com.yupi.yupicturebackend.model.dto.space.SpaceAddRequest;
import com.yupi.yupicturebackend.model.dto.space.SpaceQueryRequest;
import com.yupi.yupicturebackend.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author MJB_Computer
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-06-08 16:10:27
*/
public interface SpaceService extends IService<Space> {

    //是否为创建时检验
    void validSpace(Space space, boolean add);

    //根据空间级别填充对象
    void fillSpaceBysSpaceLevel(Space space);

    //创建空间
    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);
    //获取空间包装类（单条）
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);
    //获取空间包装类（分页）
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);
    //获取查询对象
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);
    //校验空间权限
    void checkSpaceAuth(User loginUser, Space space);
}
